<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eRPC API Reference: erpc::StaticQueue&lt; T, elementCount &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">eRPC API Reference
   &#160;<span id="projectnumber">Rev. 1.7.4</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classerpc_1_1_static_queue.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classerpc_1_1_static_queue-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">erpc::StaticQueue&lt; T, elementCount &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__infra.html">Infrastructure</a> &raquo; <a class="el" href="group__infra__utility.html">Utilities</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Template class which implements static queue as ring buffer.  
 <a href="classerpc_1_1_static_queue.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="erpc__static__queue_8h_source.html">erpc_static_queue.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a248662ae7d3a228d056332389739b941"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#a248662ae7d3a228d056332389739b941">StaticQueue</a> (void)</td></tr>
<tr class="memdesc:a248662ae7d3a228d056332389739b941"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor of <a class="el" href="classerpc_1_1_static_queue.html" title="Template class which implements static queue as ring buffer. ">StaticQueue</a> class.  <a href="#a248662ae7d3a228d056332389739b941">More...</a><br /></td></tr>
<tr class="separator:a248662ae7d3a228d056332389739b941"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24ddc2195588cee38e390652f9a6d070"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#a24ddc2195588cee38e390652f9a6d070">~StaticQueue</a> (void)</td></tr>
<tr class="memdesc:a24ddc2195588cee38e390652f9a6d070"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor of <a class="el" href="classerpc_1_1_static_queue.html" title="Template class which implements static queue as ring buffer. ">StaticQueue</a> class.  <a href="#a24ddc2195588cee38e390652f9a6d070">More...</a><br /></td></tr>
<tr class="separator:a24ddc2195588cee38e390652f9a6d070"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1fe280f10fdf322ae75f16d80b812cc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#ab1fe280f10fdf322ae75f16d80b812cc">add</a> (T element)</td></tr>
<tr class="memdesc:ab1fe280f10fdf322ae75f16d80b812cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function adds element to queue.  <a href="#ab1fe280f10fdf322ae75f16d80b812cc">More...</a><br /></td></tr>
<tr class="separator:ab1fe280f10fdf322ae75f16d80b812cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50621cf1d1676983bbf95c7dbf178229"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#a50621cf1d1676983bbf95c7dbf178229">get</a> (T *element)</td></tr>
<tr class="memdesc:a50621cf1d1676983bbf95c7dbf178229"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns element from queue.  <a href="#a50621cf1d1676983bbf95c7dbf178229">More...</a><br /></td></tr>
<tr class="separator:a50621cf1d1676983bbf95c7dbf178229"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90d03fc6a09db2f2e9ad4f722ba81547"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#a90d03fc6a09db2f2e9ad4f722ba81547">size</a> (void)</td></tr>
<tr class="memdesc:a90d03fc6a09db2f2e9ad4f722ba81547"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns number of elements in queue.  <a href="#a90d03fc6a09db2f2e9ad4f722ba81547">More...</a><br /></td></tr>
<tr class="separator:a90d03fc6a09db2f2e9ad4f722ba81547"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ad10392812527307c0f7b411fd5ceb8ee"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#ad10392812527307c0f7b411fd5ceb8ee">m_storage</a> [elementCount][(sizeof(T)+sizeof(uint64_t)-1)/                                                                                                                                           sizeof(uint64_t)]</td></tr>
<tr class="separator:ad10392812527307c0f7b411fd5ceb8ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c43f1fba589c88fbb22a0e8b237d58c"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#a0c43f1fba589c88fbb22a0e8b237d58c">m_capacity</a></td></tr>
<tr class="separator:a0c43f1fba589c88fbb22a0e8b237d58c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5b8df6fb776578ca3d8ddf5b4187af2"><td class="memItemLeft" align="right" valign="top">uint32_t volatile&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#aa5b8df6fb776578ca3d8ddf5b4187af2">m_head</a></td></tr>
<tr class="separator:aa5b8df6fb776578ca3d8ddf5b4187af2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af18992edddaa6bfb26713fde997273b8"><td class="memItemLeft" align="right" valign="top">uint32_t volatile&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_static_queue.html#af18992edddaa6bfb26713fde997273b8">m_tail</a></td></tr>
<tr class="separator:af18992edddaa6bfb26713fde997273b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class T, uint32_t elementCount&gt;<br />
class erpc::StaticQueue&lt; T, elementCount &gt;</h3>

<p>Template class which implements static queue as ring buffer. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a248662ae7d3a228d056332389739b941"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::<a class="el" href="classerpc_1_1_static_queue.html">StaticQueue</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor of <a class="el" href="classerpc_1_1_static_queue.html" title="Template class which implements static queue as ring buffer. ">StaticQueue</a> class. </p>
<p>This function sets capacity of queue, m_head and m_tail indexes to zero. </p>

</div>
</div>
<a class="anchor" id="a24ddc2195588cee38e390652f9a6d070"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::~<a class="el" href="classerpc_1_1_static_queue.html">StaticQueue</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor of <a class="el" href="classerpc_1_1_static_queue.html" title="Template class which implements static queue as ring buffer. ">StaticQueue</a> class. </p>
<p>This function free allocated buffer for m_data. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ab1fe280f10fdf322ae75f16d80b812cc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::add </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>element</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function adds element to queue. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">element</td><td>Element for adding.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">true</td><td>Element was added. </td></tr>
    <tr><td class="paramname">false</td><td>Element was not added, queue is full. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a50621cf1d1676983bbf95c7dbf178229"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::get </td>
          <td>(</td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>element</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function returns element from queue. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">element</td><td>Pointer to element to which will be copied element from queue.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">true</td><td>Element was copied from queue. </td></tr>
    <tr><td class="paramname">false</td><td>Element was not copied, queue is empty. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a90d03fc6a09db2f2e9ad4f722ba81547"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::size </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function returns number of elements in queue. </p>
<dl class="section return"><dt>Returns</dt><dd>Number of elements in queue. </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="ad10392812527307c0f7b411fd5ceb8ee"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t <a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::m_storage[elementCount][(sizeof(T)+sizeof(uint64_t)-1)/                                                                       sizeof(uint64_t)]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Preallocated space based on data type size and elements count. </p>

</div>
</div>
<a class="anchor" id="a0c43f1fba589c88fbb22a0e8b237d58c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t <a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::m_capacity</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Capacity of queue </p>

</div>
</div>
<a class="anchor" id="aa5b8df6fb776578ca3d8ddf5b4187af2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t volatile <a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::m_head</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Index to free slot </p>

</div>
</div>
<a class="anchor" id="af18992edddaa6bfb26713fde997273b8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, uint32_t elementCount&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t volatile <a class="el" href="classerpc_1_1_static_queue.html">erpc::StaticQueue</a>&lt; T, elementCount &gt;::m_tail</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Index to slot with m_data </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="erpc__static__queue_8h_source.html">erpc_static_queue.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">Copyright 2016-2020 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
